package example.documentbased.editorModule.common
{
	import example.documentbased.editorModule.models.EditorModuleModel;
	import example.documentbased.mainModule.mediations.EditorsFacade;
	import example.documentbased.mainModule.models.vo.DocumentVO;
	
	import org.etherframework.IEther;

	public class EditorViewHelper
	{
		private static var _editorsFacade:EditorsFacade;
		
		public function EditorViewHelper(editorsFacade:EditorsFacade)
		{
			_editorsFacade = editorsFacade;
		}
		
		public static function getIsEditedDocument(document:DocumentVO):Boolean
		{
			var ether:IEther = _editorsFacade.ether;
			var model:EditorModuleModel;
			
			model = ether.mediations.execute.binding(
				_editorsFacade.getEditorModel(document.editorId)) as EditorModuleModel;
			
			return (model) ? model.getIsEditedDocument(document) : false;
		}
	}
}